public class User {
    public String login(String username,String password){
        if("admin".equalsIgnoreCase(username) && "admin123".equalsIgnoreCase(password)){
            return "<html><h1><i>success</i></h1></html>";
        }
        return "<!DOCTYPE html><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><head>\n" +
                "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n" +
                "    \n" +
                "    <title>无法访问此页</title>\n" +
                "    <link href=\"ErrorPageStyles.css\" rel=\"stylesheet\" type=\"text/css\">\n" +
                "    <script language=\"javascript\" src=\"ms-appx-web:///Assets/ErrorPages/ErrorPageScripts.js\" type=\"text/javascript\"></script>\n" +
                "    <script language=\"javascript\" type=\"text/javascript\">\n" +
                "        var L_Unavailable_Title_TEXT = \"无法访问此页\"; // title for when user is connected to internet\n" +
                "        var L_Disconnected_Title_TEXT = \"你尚未连接\"; // title for when user is disconnected from internet\n" +
                "\n" +
                "        window.onload = function () {\n" +
                "            var url = getUrl();\n" +
                "            var urlElements = document.getElementsByClassName(\"webpageURL\");\n" +
                "            for (var i = 0; i < urlElements.length; i++)\n" +
                "            {\n" +
                "                urlElements[i].textContent = url;\n" +
                "            }\n" +
                "\n" +
                "            getInfo();\n" +
                "            goToLocalizedErrorPage();\n" +
                "        }\n" +
                "\n" +
                "        function getInfo()\n" +
                "        {\n" +
                "            //first check if user is connected to the internet\n" +
                "            checkConnection();\n" +
                "\n" +
                "            //attach an event to detect changes in network connectivity\n" +
                "            if (document.addEventListener)\n" +
                "            {\n" +
                "                addEventListener(\"offline\", reportConnectionEvent, false);\n" +
                "            }\n" +
                "            else\n" +
                "            {\n" +
                "                attachEvent(\"onoffline\", reportConnectionEvent);\n" +
                "            }\n" +
                "\n" +
                "            //set events to fire\n" +
                "            document.body.ononline = reportConnectionEvent;\n" +
                "            document.body.onoffline = reportConnectionEvent;\n" +
                "        }\n" +
                "\n" +
                "        function checkConnection()\n" +
                "        {\n" +
                "            var notConnected = document.getElementById(\"NotConnected\");\n" +
                "            var pageUnavailable = document.getElementById(\"PageUnavailable\");\n" +
                "\n" +
                "            if (navigator.onLine) //the network connection is connected\n" +
                "            {\n" +
                "                document.title = L_Unavailable_Title_TEXT;\n" +
                "\n" +
                "                notConnected.style.display = \"none\";\n" +
                "                pageUnavailable.style.display = \"\";\n" +
                "            }\n" +
                "            else // no internet\n" +
                "            {\n" +
                "                document.title = L_Disconnected_Title_TEXT;\n" +
                "\n" +
                "                notConnected.style.display = \"\";\n" +
                "                pageUnavailable.style.display = \"none\";\n" +
                "            }\n" +
                "        }\n" +
                "\n" +
                "        function reportConnectionEvent(e)\n" +
                "        {\n" +
                "            if (!e) e = window.event;\n" +
                "\n" +
                "            if ('online' == e.type)\n" +
                "            {\n" +
                "                setTimeout ( \"clickRefresh()\", 1000 ); //using a setTimeout to account for any lag between us getting the connected event and the machine obtaining an IP\n" +
                "            }\n" +
                "            else if ('offline' == e.type)\n" +
                "            {\n" +
                "                checkConnection();\n" +
                "            }\n" +
                "            else\n" +
                "            {\n" +
                "                checkConnection();\n" +
                "            }\n" +
                "        }\n" +
                "    </script>\n" +
                "</head>\n" +
                "\n" +
                "<body>\n" +
                "    <div id=\"Wrapper\">\n" +
                "        <div id=\"PageUnavailable\">\n" +
                "            <table>\n" +
                "                <tbody><tr>\n" +
                "                    <td>\n" +
                "                        <span id=\"icon\">\uEB7D</span>\n" +
                "                    </td>\n" +
                "                    <td>\n" +
                "                        <h1 id=\"dnserror_unavailable_header\">嗯，我们无法访问该页面。</h1>\n" +
                "                        <p id=\"dnserror_unavailable_body\">尝试此操作</p>\n" +
                "                        <ul>\n" +
                "                            <li><id id=\"dnserror_unavailable_righturl\">请确保你已获取正确的网址:</id> <span class=\"webpageURL\">http://sztz.xupt.edu.cn</span></li>\n" +
                "                            <li><a onclick=\"clickRefresh(); return false;\" href=\"#\"><id id=\"dnserror_unavailable_refresh\">刷新页面</id></a></li>\n" +
                "                            <li><a onclick=\"clickSearch(); return false;\" href=\"#\"><id id=\"dnserror_unavailable_search\">搜索你想要的内容</id></a></li>\n" +
                "                        </ul>\n" +
                "                    </td>\n" +
                "                </tr>\n" +
                "            </tbody></table>\n" +
                "        </div>\n" +
                "        <div id=\"NotConnected\" style=\"display: none;\">\n" +
                "            <table>\n" +
                "                <tbody><tr>\n" +
                "                    <td>\n" +
                "                        <span id=\"icon\">\uEB7C</span>\n" +
                "                    </td>\n" +
                "                    <td>\n" +
                "                        <h1 id=\"dnserror_offline_header\">你尚未连接</h1>\n" +
                "                        <p id=\"dnserror_offline_body1\">Web 因你而不同。 </p>\n" +
                "                        <p id=\"dnserror_offline_body2\">我们会让你重新联机</p>\n" +
                "                        <ul>\n" +
                "                            <li><id id=\"dnserror_offline_checkcables\">请检查网络电缆是否已插好。</id></li>\n" +
                "                            <li><id id=\"dnserror_offline_airplanemode\">请确保你不在飞行模式下。</id></li>\n" +
                "                            <li><id id=\"dnserror_offline_wirelessswitch\">查看你的无线交换机是否已启用。</id></li>\n" +
                "                            <li><id id=\"dnserror_offline_restartrouter\">重启路由器。</id></li>\n" +
                "                        </ul>\n" +
                "                        <br>\n" +
                "                        <button class=\"pushbutton\" onclick=\"window.location='ms-settings:network'\" type=\"submit\"><id id=\"dnserror_offline_networksettings\">转到网络设置</id></button>\n" +
                "                    </td>\n" +
                "                </tr>\n" +
                "            </tbody></table>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "\n" +
                " </body></html>"
                ;
    }

}

